package agenda;

public class GeneradorXML {

    private Agenda miAgenda;

    public GeneradorXML() {
	super();
    }

    public GeneradorXML(Agenda miAgenda) {
	super();
	this.miAgenda = miAgenda;
	generaXML();
    }

    public String generaXML() {
	String elXML;

	elXML = "<?xml version=\"1.0\" encoding='ISO-8859-1'?>";
	elXML += "\n<?xml-stylesheet href=\"agenda.xsl\" type=\"text/xsl\"?>";
	for (int i = 0; i < miAgenda.getNInstancias(); i++) {
	    elXML += "\n" + miAgenda.traeEntrada(i).toXML();
	}

	elXML += "\n</agenda>";

	return elXML;
    }
}
